Optimal. Leaf size=299 \[ -\frac{(A b-a B) \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{m/2} (c \sec (e+f x))^{m+1} F_1\left (\frac{1}{2};\frac{m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{c f \left (a^2-b^2\right )}+\frac{a (A b-a B) \sin (e+f x) \cos ^2(e+f x)^{\frac{m+1}{2}} (c \sec (e+f x))^{m+1} F_1\left (\frac{1}{2};\frac{m+1}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{b c f \left (a^2-b^2\right )}-\frac{B c \sin (e+f x) (c \sec (e+f x))^{m-1} \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right )}{b f (1-m) \sqrt{\sin ^2(e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.575894, antiderivative size = 299, normalized size of antiderivative = 1., number of steps used = 10, number of rules used = 8, integrand size = 33, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.242, Rules used = {2960, 4038, 3772, 2643, 3869, 2823, 3189, 429} \[ -\frac{(A b-a B) \sin (e+f x) \cos (e+f x) \cos ^2(e+f x)^{m/2} (c \sec (e+f x))^{m+1} F_1\left (\frac{1}{2};\frac{m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{c f \left (a^2-b^2\right )}+\frac{a (A b-a B) \sin (e+f x) \cos ^2(e+f x)^{\frac{m+1}{2}} (c \sec (e+f x))^{m+1} F_1\left (\frac{1}{2};\frac{m+1}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right )}{b c f \left (a^2-b^2\right )}-\frac{B c \sin (e+f x) (c \sec (e+f x))^{m-1} \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right )}{b f (1-m) \sqrt{\sin ^2(e+f x)}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2960
Rule 4038
Rule 3772
Rule 2643
Rule 3869
Rule 2823
Rule 3189
Rule 429
Rubi steps
\begin{align*} \int \frac{(A+B \cos (e+f x)) (c \sec (e+f x))^m}{a+b \cos (e+f x)} \, dx &=\int \frac{(c \sec (e+f x))^m (B+A \sec (e+f x))}{b+a \sec (e+f x)} \, dx\\ &=\frac{B \int (c \sec (e+f x))^m \, dx}{b}+\frac{(A b-a B) \int \frac{(c \sec (e+f x))^{1+m}}{b+a \sec (e+f x)} \, dx}{b c}\\ &=\frac{\left (B \left (\frac{\cos (e+f x)}{c}\right )^m (c \sec (e+f x))^m\right ) \int \left (\frac{\cos (e+f x)}{c}\right )^{-m} \, dx}{b}+\frac{\left ((A b-a B) \cos ^{1+m}(e+f x) (c \sec (e+f x))^{1+m}\right ) \int \frac{\cos ^{-m}(e+f x)}{a+b \cos (e+f x)} \, dx}{b c}\\ &=-\frac{B \cos (e+f x) \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{b f (1-m) \sqrt{\sin ^2(e+f x)}}-\frac{\left ((A b-a B) \cos ^{1+m}(e+f x) (c \sec (e+f x))^{1+m}\right ) \int \frac{\cos ^{1-m}(e+f x)}{a^2-b^2 \cos ^2(e+f x)} \, dx}{c}+\frac{\left (a (A b-a B) \cos ^{1+m}(e+f x) (c \sec (e+f x))^{1+m}\right ) \int \frac{\cos ^{-m}(e+f x)}{a^2-b^2 \cos ^2(e+f x)} \, dx}{b c}\\ &=-\frac{B \cos (e+f x) \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{b f (1-m) \sqrt{\sin ^2(e+f x)}}+\frac{\left (a (A b-a B) \cos ^{1+2 \left (-\frac{1}{2}-\frac{m}{2}\right )+m}(e+f x) \cos ^2(e+f x)^{\frac{1}{2}+\frac{m}{2}} (c \sec (e+f x))^{1+m}\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{\frac{1}{2} (-1-m)}}{a^2-b^2+b^2 x^2} \, dx,x,\sin (e+f x)\right )}{b c f}-\frac{\left ((A b-a B) \cos (e+f x) \cos ^2(e+f x)^{m/2} (c \sec (e+f x))^{1+m}\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{-m/2}}{a^2-b^2+b^2 x^2} \, dx,x,\sin (e+f x)\right )}{c f}\\ &=-\frac{(A b-a B) F_1\left (\frac{1}{2};\frac{m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos (e+f x) \cos ^2(e+f x)^{m/2} (c \sec (e+f x))^{1+m} \sin (e+f x)}{\left (a^2-b^2\right ) c f}+\frac{a (A b-a B) F_1\left (\frac{1}{2};\frac{1+m}{2},1;\frac{3}{2};\sin ^2(e+f x),-\frac{b^2 \sin ^2(e+f x)}{a^2-b^2}\right ) \cos ^2(e+f x)^{\frac{1+m}{2}} (c \sec (e+f x))^{1+m} \sin (e+f x)}{b \left (a^2-b^2\right ) c f}-\frac{B \cos (e+f x) \, _2F_1\left (\frac{1}{2},\frac{1-m}{2};\frac{3-m}{2};\cos ^2(e+f x)\right ) (c \sec (e+f x))^m \sin (e+f x)}{b f (1-m) \sqrt{\sin ^2(e+f x)}}\\ \end{align*}
Mathematica [B] time = 26.5004, size = 10630, normalized size = 35.55 \[ \text{Result too large to show} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [F] time = 1.394, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( A+B\cos \left ( fx+e \right ) \right ) \left ( c\sec \left ( fx+e \right ) \right ) ^{m}}{a+b\cos \left ( fx+e \right ) }}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \cos \left (f x + e\right ) + A\right )} \left (c \sec \left (f x + e\right )\right )^{m}}{b \cos \left (f x + e\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F] time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{{\left (B \cos \left (f x + e\right ) + A\right )} \left (c \sec \left (f x + e\right )\right )^{m}}{b \cos \left (f x + e\right ) + a}, x\right ) \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (c \sec{\left (e + f x \right )}\right )^{m} \left (A + B \cos{\left (e + f x \right )}\right )}{a + b \cos{\left (e + f x \right )}}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (B \cos \left (f x + e\right ) + A\right )} \left (c \sec \left (f x + e\right )\right )^{m}}{b \cos \left (f x + e\right ) + a}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]